package com.bupt.kgplatform.controller;

import com.bupt.kgplatform.Util.R;
import com.bupt.kgplatform.entity.pojo.LoginInfo;
import com.bupt.kgplatform.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * UserController
 *
 * @author zrz
 * @date 2024/5/13
 * @time 15:28
 * @Description 用户关节接口
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R login(@RequestBody LoginInfo loginInfo){
        return userService.login(loginInfo);
    }

    @GetMapping("getAllUser")
    public R getAllUser(){
        return userService.getAllUser();
    }

    @PostMapping("QueryUser")
    public R QueryUser(){
        return null;
    }


    @GetMapping("/test")
    public R test(){
        return R.ok("我收到了");
    }
}
